home *** CD-ROM | disk | FTP | other *** search
- #ifndef _LOGINFO_H_
- #define _LOGINFO_H_
- /*
- * $RCSfile: loginfo.h,v $
- * $Revision: 1.1.1.1 $
- * $Date: 1996/05/04 21:55:20 $
- */
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
-
- #include "lsn.h"
-
- typedef struct LogInfo_s LOGINFO;
-
- /*
- * define the structure that holds the state of the open log
- */
- struct LogInfo_s {
-
- VOLID volid; /* volid that holds the log file */
- SHORTPID logFileAddr; /* page address of first page in log*/
- BUFGROUP *writeGroup; /* buffer group for log writes */
- int writePages; /* number of pages in write group */
- unsigned char page2size; /* log 2 of log page size */
- unsigned short pageSize; /* page size of a log page */
- unsigned int pageMask; /* mask of page size */
- unsigned short usableBytes; /* usable bytes on the page */
- unsigned short lastUsableByte; /* last usable byte on the page */
- SHORTPID tailPid; /* pid of current tail of log file */
- LSNOFFSET tailLSN; /* byte offset of current end of log*/
- LSNOFFSET currentLSN; /* byte off. of curr. last log record*/
- PAGEHASH *tailBuffer; /* pointer to the current end of log*/
- GROUPLINK *tailLink; /* link of the tail buffer of the log*/
- int wrapCount; /* current wrap count of log */
- FORCEMARK logRecordCount; /* monotically increasing log rec count */
- FORCEMARK forceMark; /* current force mark of log */
-
- /*
- * variable to keep track of the latest tailLSN that we have
- * heard about from the server. This is our current estimate
- * of the end of the log
- */
- LSN lastTailLSN;
-
- /*
- * Pointer to lrc to init pages with. Will point to eiter OneLRC or
- * lastTailLSN depending on value of initLRCisLSN.
- */
- #ifdef __cplusplus
- const
- #endif __cplusplus
- LRC * initLRC;
-
- /*
- * Used to determine how LRCs are initialized on newly allocated
- * pages
- */
- BOOL initLRCisLSN;
-
- FLAGS flags;
-
- MAGIC magic;
-
- };
-
-
- /*
- * define the size of the undo buffer
- */
- #define LOG_UNDO_BUFFER_SIZE (1 << 15)
-
-
- /*
- * define the open log magic number
- */
- #define LOGINFO_MAGIC 0xd7af5dba
-
-
- #if MAGIC_CHECKING IS_ENABLED
-
-
- #define INIT_LOGINFO_MAGIC(_logInfo) \
- \
- (_logInfo)->magic = LOGINFO_MAGIC;
-
-
- #define CHECK_LOGINFO_MAGIC(_logInfo) \
- \
- if ((_logInfo)->magic != LOGINFO_MAGIC) { \
- SM_ERROR(TYPE_FATAL, esmINTERNAL); \
- }
-
-
- #else
-
-
- #define INIT_LOGINFO_MAGIC(_logInfo)
-
- #define CHECK_LOGINFO_MAGIC(_logInfo)
-
-
- #endif
-
-
- /*
- * define the flags of the open log structure
- */
- #define LOG_CLOSE 0x1
- #define LOG_CHECKPOINT_IN_PROGRESS 0x2
- #define LOG_DIRTYFORCE_IN_PROGRESS 0x4
-
-
- /*
- * define the phases of the log processing
- */
- #define ANALYSIS_PHASE 1
- #define REDO_PHASE 2
-
- #endif _LOGINFO_H_
-